package 代码记录.指定公司代码练习记录.华为_2024.华为od_2024笔试真题;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author zx
 * @create 2024-02-28 20:23
 * api集群负载统计 - 100%
 */
public class Test2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        List<String[]> list = new ArrayList<>();
        for(int i = 0;i < n;i++){
            list.add(sc.nextLine().split("/"));
        }
        String[] nums = sc.nextLine().split(" ");
        int l = Integer.parseInt(nums[0]);
        String str = nums[1];
        int res = helper(list, l, str);
        System.out.println(res);
    }
    private static int helper(List<String[]> list, int l, String str) {
        int res = 0;
        for (String[] strings : list) {
            int length = strings.length;
            if(length <= l){
                continue;
            }
            if(strings[l].equals(str)){
                res++;
            }
        }
        return res;
    }
}
